package com.slaffka.services;

import com.slaffka.mapper.UserMapper;
import com.slaffka.model._User;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * _User: v.tsapaev
 * Date: 18.02.12
 * Time: 0:30
 * To change this template use File | Settings | File Templates.
 */
@Component
public class _UserServiceImpl implements _UserService {

    //@Autowired
    private UserMapper userMapper;

    //    public void setUserMapper(UserMapper userMapper) {
//        System.out.println("********userMapper = " + userMapper);
//        this.userMapper = userMapper;
//    }
    public _User getUserById(Long userId) {
        System.out.println("usermaper = " + userMapper);
        return this.userMapper.getUserById(userId);
    }

    public List<_User> getAllUsers(){
        return userMapper.getUsers();
    }

    public void addUser(_User user){
        userMapper.addUser(user);
    }
}
